/*
 * Copyright (c) 2010, Nikolaus Moll
 * All rights reserved.
 */
package net.miblounge.gradecalculator.core.enums;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

@XmlRootElement(namespace = "http://gradecalculator.net/")
@XmlType( 
 propOrder = { "abbreviation", "name" } 
) 
public abstract class AbstractEnumType {

	private String name = "uninitialized";
	private String abbreviation = "ui";

	public AbstractEnumType()
	{
		name = "";
		abbreviation = "";
	}
	
	protected AbstractEnumType(final String name, final String abbreviation)
	{
		this.name = name;
		this.abbreviation = abbreviation;
	}

	public abstract int ordinal();

	@XmlElement(name = "name") 
	public String getName() {
		return name;
	}
	public void setName(final String name) {
		this.name = name; 
	}

	@XmlElement(name = "abbreviation") 
	public String getAbbreviation() {
		return abbreviation;
	}
	public void setAbbreviation(final String abbreviation) {
		this.abbreviation = abbreviation; 
	}

	@Override
	public String toString() {
		return getAbbreviation();
	}
	
}
